<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2020/2/17
 * Time: 19:32
 */

namespace app\admin\validate;


class IDMustBePositiveInt extends BaseValidate
{
    protected $rule= [
     'id'=>'require|isPositiveInteger',

    ];
    protected function isPositiveInteger($value,$rule='',$data='', $field)
    {
        if (is_numeric($value) && is_int($value + 0) && ($value + 0) > 0) {
            return true;
        } else {
            return false;
        }
    }
}